<?php
/**
 * File:          KValidatorElement
 * Description:   -
 * Author:        Kovac "Kovacou'" Alexandre (www.kovacou.fr)
 * Last Update:   23/04/2011
 */

   abstract class KValidatorElement {
      protected   $name,
                  $value,
                  $sensitive,
                  $required,
                  $trim = true,
                  $params = array (),
                  $error,
                  $uniqid;
      
      
      public function __construct ($name, $uniqid) {
         $this->name      = $name;
         $this->uniqid    = $uniqid;
         $this->value     = KValidator::load ($this->uniqid)->getData ($name, false);
         $this->isset     = KValidator::load ($this->uniqid)->isSetData ($name);
         $this->required  = true;
         $this->sensitive = true;
      }
      
      
      public function required ($value) {
         $this->required = (bool) $value;
         
         return $this;
      }
      
      
      protected function _parameter ($package, $param) {
         $class = sprintf ("KValidator_Parameter_%s_%s", $package, ucfirst ($param));
         return $this->params[$param] = New $class ();
      }
   }
 
/**
 * End
 * Of
 * File
 */
?>